package com.ruoyi.am.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.am.mapper.AmApplyMapper;
import com.ruoyi.am.domain.AmApply;
import com.ruoyi.am.service.IAmApplyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 申请备班Service业务层处理
 * 
 * @author hkkk
 * @date 2020-12-19
 */
@Service
public class AmApplyServiceImpl implements IAmApplyService 
{
    @Autowired
    private AmApplyMapper amApplyMapper;

    /**
     * 查询申请备班
     * 
     * @param id 申请备班ID
     * @return 申请备班
     */
    @Override
    public AmApply selectAmApplyById(Long id)
    {
        return amApplyMapper.selectAmApplyById(id);
    }

    /**
     * 查询申请备班列表
     * 
     * @param amApply 申请备班
     * @return 申请备班
     */
    @Override
    public List<AmApply> selectAmApplyList(AmApply amApply)
    {
        return amApplyMapper.selectAmApplyList(amApply);
    }

    /**
     * 新增申请备班
     * 
     * @param amApply 申请备班
     * @return 结果
     */
    @Override
    public int insertAmApply(AmApply amApply)
    {
        amApply.setCreateTime(DateUtils.getNowDate());
        return amApplyMapper.insertAmApply(amApply);
    }

    /**
     * 修改申请备班
     * 
     * @param amApply 申请备班
     * @return 结果
     */
    @Override
    public int updateAmApply(AmApply amApply)
    {
        return amApplyMapper.updateAmApply(amApply);
    }

    /**
     * 删除申请备班对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAmApplyByIds(String ids)
    {
        return amApplyMapper.deleteAmApplyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除申请备班信息
     * 
     * @param id 申请备班ID
     * @return 结果
     */
    @Override
    public int deleteAmApplyById(Long id)
    {
        return amApplyMapper.deleteAmApplyById(id);
    }
}
